package com.prj.component.response;

import com.prj.component.exception.BusinessException;

public abstract class ResponseCallBack {

	//private static final Log logger = LogFactory.getLog(ResponseCallBack.class);
	
	public ResponseInfo sendRequest(Object...obj) {
		String message = "success";
		int code = 200;
		Object infoList = null;
		try {
			infoList = execute(obj);
		} catch (BusinessException e) {
			code = e.getCode();
			message = e.getMessage();
		}
		return new ResponseInfo(code, message, infoList);
	}
	
	public abstract Object execute (Object...obj);
}

